﻿ 

				
				    //Code Header here                
using System;
using Microsoft.SPOT;
using nRF24L10P.Helper;

namespace nRF24L10P.Register
{
				
	public class Register_CONFIG:RegisterBase
	{

		public Register_CONFIG(nRF24L10P device):base(device,1,0x00)
		{
			
		}			 
		//single byte property
		public bool MASK_RX_DR
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B6 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B6 ,value);
			}
		}
		//single byte property
		public bool MASK_TX_DS
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B5 ,value);
			}
		}
		//single byte property
		public bool MASK_MAX_RT
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B4 ,value);
			}
		}
		//single byte property
		public bool EN_CRC
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B3 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B3 ,value);
			}
		}
		//single byte property
		public bool CRCO
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B2 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B2 ,value);
			}
		}
		//single byte property
		public bool PWR_UP
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B1 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B1 ,value);
			}
		}
		//single byte property
		public bool PRIM_RX
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B0 ,value);
			}
		}
	}
	public class Register_EN_AA:RegisterBase
	{

		public Register_EN_AA(nRF24L10P device):base(device,1,0x01)
		{
			
		}			 
		//single byte property
		public bool ENAA_P5
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B5 ,value);
			}
		}
		//single byte property
		public bool ENAA_P4
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B4 ,value);
			}
		}
		//single byte property
		public bool ENAA_P3
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B3 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B3 ,value);
			}
		}
		//single byte property
		public bool ENAA_P2
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B2 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B2 ,value);
			}
		}
		//single byte property
		public bool ENAA_P1
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B1 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B1 ,value);
			}
		}
		//single byte property
		public bool ENAA_P0
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B0 ,value);
			}
		}
	}
	public class Register_EN_RXADDR:RegisterBase
	{

		public Register_EN_RXADDR(nRF24L10P device):base(device,1,0x02)
		{
			
		}			 
		//single byte property
		public bool ERX_P5
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B5 ,value);
			}
		}
		//single byte property
		public bool ERX_P4
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B4 ,value);
			}
		}
		//single byte property
		public bool ERX_P3
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B3 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B3 ,value);
			}
		}
		//single byte property
		public bool ERX_P2
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B2 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B2 ,value);
			}
		}
		//single byte property
		public bool ERX_P1
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B1 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B1 ,value);
			}
		}
		//single byte property
		public bool ERX_P0
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B0 ,value);
			}
		}
	}
	public class Register_SETUP_AW:RegisterBase
	{

		public Register_SETUP_AW(nRF24L10P device):base(device,1,0x03)
		{
			
		}			 
		//multi byte property
		public byte AW
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 1, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,1, 0);
			}				
		}
	}
	public class Register_SETUP_RETR:RegisterBase
	{

		public Register_SETUP_RETR(nRF24L10P device):base(device,1,0x04)
		{
			
		}			 
		//multi byte property
		public byte ARD
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 7, 4);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,7, 4);
			}				
		}
		//multi byte property
		public byte ARC
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 3, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,3, 0);
			}				
		}
	}
	public class Register_RF_CH:RegisterBase
	{

		public Register_RF_CH(nRF24L10P device):base(device,1,0x05)
		{
			
		}			 
		//multi byte property
		public byte RF_CH
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 6, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,6, 0);
			}				
		}
	}
	public class Register_RF_SETUP:RegisterBase
	{

		public Register_RF_SETUP(nRF24L10P device):base(device,1,0x06)
		{
			
		}			 
		//single byte property
		public bool CONT_WAVE
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B7 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B7 ,value);
			}
		}
		//single byte property
		public bool RF_DR_LOW
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B5 ,value);
			}
		}
		//single byte property
		public bool PLL_LOCK
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B4 ,value);
			}
		}
		//single byte property
		public bool RF_DR_HIGH
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B3 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B3 ,value);
			}
		}
		//multi byte property
		public byte RF_PWR
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 02, 1);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,02, 1);
			}				
		}
	}
	public class Register_STATUS:RegisterBase
	{

		public Register_STATUS(nRF24L10P device):base(device,1,0x07)
		{
			
		}			 
		//single byte property
		public bool RX_DR
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B6 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B6 ,value);
			}
		}
		//single byte property
		public bool TX_DS
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B5 ,value);
			}
		}
		//single byte property
		public bool MAX_RT
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B4 ,value);
			}
		}
		//multi byte property
		public byte RX_P_NO
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 3, 1);
			}
		}
		//single byte property
		public bool TX_FULL
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
		}
	}
	public class Register_OBSERVE_TX:RegisterBase
	{

		public Register_OBSERVE_TX(nRF24L10P device):base(device,1,0x08)
		{
			
		}			 
		//multi byte property
		public byte PLOS_CNT
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 7, 4);
			}
		}
		//multi byte property
		public byte ARC_CNT
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 3, 0);
			}
		}
	}
	public class Register_RPD:RegisterBase
	{

		public Register_RPD(nRF24L10P device):base(device,1,0x09)
		{
			
		}			 
		//single byte property
		public bool RPD
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
		}
	}
	public class Register_RX_ADDR_P0:RegisterBase
	{

		public Register_RX_ADDR_P0(nRF24L10P device):base(device,5,0x0A)
		{
			
		}			 
	}
	public class Register_RX_ADDR_P1:RegisterBase
	{

		public Register_RX_ADDR_P1(nRF24L10P device):base(device,5,0x0B)
		{
			
		}			 
	}
	public class Register_RX_ADDR_P2:RegisterBase
	{

		public Register_RX_ADDR_P2(nRF24L10P device):base(device,1,0x0C)
		{
			
		}			 
	}
	public class Register_RX_ADDR_P3:RegisterBase
	{

		public Register_RX_ADDR_P3(nRF24L10P device):base(device,1,0x0D)
		{
			
		}			 
	}
	public class Register_RX_ADDR_P4:RegisterBase
	{

		public Register_RX_ADDR_P4(nRF24L10P device):base(device,1,0x0E)
		{
			
		}			 
	}
	public class Register_RX_ADDR_P5:RegisterBase
	{

		public Register_RX_ADDR_P5(nRF24L10P device):base(device,1,0x0F)
		{
			
		}			 
	}
	public class Register_TX_ADDR:RegisterBase
	{

		public Register_TX_ADDR(nRF24L10P device):base(device,5,0x10)
		{
			
		}			 
	}
	public class Register_RX_PW_P0:RegisterBase
	{

		public Register_RX_PW_P0(nRF24L10P device):base(device,1,0x11)
		{
			
		}			 
		//multi byte property
		public byte RX_PW_P0
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 5, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,5, 0);
			}				
		}
	}
	public class Register_RX_PW_P1:RegisterBase
	{

		public Register_RX_PW_P1(nRF24L10P device):base(device,1,0x12)
		{
			
		}			 
		//multi byte property
		public byte RX_PW_P1
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 5, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,5, 0);
			}				
		}
	}
	public class Register_RX_PW_P2:RegisterBase
	{

		public Register_RX_PW_P2(nRF24L10P device):base(device,1,0x13)
		{
			
		}			 
		//multi byte property
		public byte RX_PW_P2
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 5, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,5, 0);
			}				
		}
	}
	public class Register_RX_PW_P3:RegisterBase
	{

		public Register_RX_PW_P3(nRF24L10P device):base(device,1,0x14)
		{
			
		}			 
		//multi byte property
		public byte RX_PW_P3
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 5, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,5, 0);
			}				
		}
	}
	public class Register_RX_PW_P4:RegisterBase
	{

		public Register_RX_PW_P4(nRF24L10P device):base(device,1,0x15)
		{
			
		}			 
		//multi byte property
		public byte RX_PW_P4
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 5, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,5, 0);
			}				
		}
	}
	public class Register_RX_PW_P5:RegisterBase
	{

		public Register_RX_PW_P5(nRF24L10P device):base(device,1,0x16)
		{
			
		}			 
		//multi byte property
		public byte RX_PW_P5
		{
			get
			{
				return BitHelper.BitExtract(firstByte, 5, 0);
			}
			set
			{
				firstByte = BitHelper.BitSet(firstByte,value,5, 0);
			}				
		}
	}
	public class Register_FIFO_STATUS:RegisterBase
	{

		public Register_FIFO_STATUS(nRF24L10P device):base(device,1,0x17)
		{
			
		}			 
		//single byte property
		public bool TX_REUSE
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B6 );
			}
		}
		//single byte property
		public bool TX_FULL
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
		}
		//single byte property
		public bool TX_EMPTY
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
		}
		//single byte property
		public bool RX_FULL
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B1 );
			}
		}
		//single byte property
		public bool RX_EMPTY
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
		}
	}
	public class Register_DYNPD:RegisterBase
	{

		public Register_DYNPD(nRF24L10P device):base(device,1,0x1C)
		{
			
		}			 
		//single byte property
		public bool DPL_P5
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B5 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B5 ,value);
			}
		}
		//single byte property
		public bool DPL_P4
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B4 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B4 ,value);
			}
		}
		//single byte property
		public bool DPL_P3
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B3 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B3 ,value);
			}
		}
		//single byte property
		public bool DPL_P2
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B2 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B2 ,value);
			}
		}
		//single byte property
		public bool DPL_P1
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B1 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B1 ,value);
			}
		}
		//single byte property
		public bool DPL_P0
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B0 ,value);
			}
		}
	}
	public class Register_FEATURE:RegisterBase
	{

		public Register_FEATURE(nRF24L10P device):base(device,1,0x1D)
		{
			
		}			 
		//single byte property
		public bool EN_DPL
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B2 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B2 ,value);
			}
		}
		//single byte property
		public bool EN_ACK_PAYd
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B1 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B1 ,value);
			}
		}
		//single byte property
		public bool EN_DYN_ACK
		{
			get 
			{
				return BitHelper.BitCheck(firstByte, BitHelper.B0 );
			}
			set 
			{
				firstByte = BitHelper.BitSet(firstByte, BitHelper.B0 ,value);
			}
		}
	}
                    
				

				

		
	
}